import Vuex from "vuex";

const store = new Vuex.Store({
  state: {
    userCity: "武汉",
    tabbarIndex: 0,
    location: "",
    canLocate: false,
    hasShowTip: false,
  },
  mutations: {
    updateCity(state, city) {
      state.userCity = city;
    },
    updateLocation(state, address) {
      state.location = address;
    },
    updateLocateState(state, enabled) {
      state.canLocate = enabled;
    },
    updateShowTipState(state, isShow) {
      state.hasShowTip = isShow;
    },
  },
  actions: {},
  modules: {},
});

export default store;
